<template>
  <div class="smart-learning">
    <h3>智学习</h3>
    <el-form ref="form" :model="learningSettings" label-width="120px">
      <el-form-item label="自动学习模式">
        <el-switch v-model="learningSettings.autoLearnMode"></el-switch>
      </el-form-item>
      <el-form-item label="训练数据集">
        <el-select v-model="learningSettings.dataset" placeholder="请选择数据集">
          <el-option label="默认数据集" value="default"></el-option>
          <el-option label="自定义数据集" value="custom"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="模型更新周期">
        <el-input-number v-model="learningSettings.updateCycle" :min="1" :max="365" label="天"></el-input-number>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="saveSettings">保存设置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    siteId: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
      learningSettings: {
        autoLearnMode: true,
        dataset: 'default',
        updateCycle: 30
      }
    };
  },
  methods: {
    saveSettings() {
      this.$message({
        type: 'success',
        message: '设置保存成功!'
      });
    }
  }
};
</script>

<style scoped lang="scss">
.smart-learning {
  padding: 20px;
}
</style>
